package com.yang.SpringTest.annotation.resourceLean;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

/**
 * <p>ResourceDemoTest测试类</p>
 *
 * @author By: chengxuyuanshitang
 * Package com.yang.SpringTest.annotation.resourceLean
 * Ceate Time 2024-04-12 16:32
 */
public class ResourceDemoTest {

    public static void main (String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (ResourceDemoConfig.class);
        String[] definitionNames = context.getBeanDefinitionNames ();
        Arrays.stream (definitionNames).forEach ((definitionName) -> System.out.println (definitionName));
        System.out.println ("--------------------");
        ResourceDemoController resourceDemoController = context.getBean (ResourceDemoController.class);
        resourceDemoController.demo ();
        context.close ();
    }

}

